const chalk = require('chalk')
const ora = require('ora')
import { LineBreak } from '@/constant';
import symbols from 'log-symbols';

export const log = (str: string, content?: string | string[]) => {
  console.log(LineBreak, symbols.success, chalk.green(replaceTemplateString(str, content)));
}
export const warn = (str: string, content?: string | string[]) => {
  console.log(LineBreak, symbols.warning, chalk.yellow(replaceTemplateString(str, content)));
}
export const error = (str: string, content?: string | string[]) => {
  console.log(LineBreak, symbols.error, chalk.red(replaceTemplateString(str, content)));
}

export const Ora = (content: string) => {
  const proce = ora(content);
  return proce;
}

export const upperFirstStrCase = (str: string) => str[0]?.toUpperCase() + str.slice(1, str.length).toLowerCase();